import { Toast, Portal } from '@ant-design/react-native';

// 提示语
const tipInfo = (msg: string = '成功！') => {
	const timer = setTimeout(() => {
		Portal.remove(key);
	}, 1900);
	const key = Toast.info(msg, 2, () => {
		clearTimeout(timer);
	});
};
/**
 * loading 提示
 * **/
const tipLoad = () => {
	const key = Toast.loading('加载中...', 0);
	return key;
};
const tipLoadClose = (key: number) => {
	Portal.remove(key);
};
export default {
	tipInfo,
	tipLoad,
	tipLoadClose
};
